package net.starwifi.duobao.web;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Controller - product.
 *
 * @author ruoo
 * @version 1.0
 */
@Controller("adminFactoryController")
@RequestMapping("/factory")
public class FactoryController extends BaseController {

   /* @Autowired
    FactoryService factoryService;

    *//**
     * 添加
     *//*
    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public String add(ModelMap model) {
        return "/factory/add";
    }


    *//**
     * 保存
     *//*
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public String save(Factory product,  RedirectAttributes redirectAttributes) {
        if (!isValid(product)) {
            return ERROR_VIEW;
        }
        factoryService.save(product);
        addFlashMessage(redirectAttributes, SUCCESS_MESSAGE);
        return "redirect:list";
    }


    *//**
     * 编辑
     *//*
    @RequestMapping(value = "/edit", method = RequestMethod.GET)
    public String edit(Long id, ModelMap model) {
        model.addAttribute("entity", factoryService.find(id));
        return "/factory/edit";
    }

    *//**
     * 更新
     *//*
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public String update(Factory product, RedirectAttributes redirectAttributes) {
        if (!isValid(product)) {
            return ERROR_VIEW;
        }
        factoryService.update(product);
        addFlashMessage(redirectAttributes, SUCCESS_MESSAGE);
        return "redirect:list";
    }


    *//**
     * 列表
     *//*
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(PageView pageView, ModelMap model,HttpServletRequest request) {
        pageView.filterQuery(request);
        model.addAttribute("page", factoryService.getScrollData(pageView));
        return "/factory/list";
    }

    *//**
     * 删除
     *//*
    @ResponseBody
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Message delete(Long[] ids) {
        factoryService.delete(ids);
        return SUCCESS_MESSAGE;
    }*/
}
